import wangling.action;
import wuke.dao.imp.DlDaoImp;
import java.util.Map;
import wuke.dao.DlDao;
import wuke.model.Dlb;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{
	private Dlb dlb;

	public Dlb getDlb() {
		return dlb;
	}

	public void setDlb(Dlb dlb) {
		this.dlb = dlb;
	}
	public String execute()throws Exception{
		DlDao dlDao=new DlDaoImp();
		Dlb user=dlDao.validate(dlb.getXh(),dlb.getKl());
		if(user!=null){
			Map session=(Map)ActionContext.getContext().getSession();
			session.put("user",user);
			return SUCCESS;
			
		}else{
			return ERROR;
		}
	}
	

}
